﻿<div class="blade-static __bottom">
    <button ng-click="saveChanges()" class="btn" ng-class="{'__disabled': detailForm != undefined && detailForm.$invalid}" ng-disabled="detailForm != undefined && detailForm.$invalid">
        <span>Ok</span>
    </button>
</div>
<div class="blade-content">
    <div class="blade-inner">
        <div class="inner-block clearfix">
            <form class="form" name="detailForm">
                <div class="form-group" ng-init="setForm(detailForm)">
                    <label class="form-label">{{ 'platform.blades.account-changePassword.labels.current-password' | translate }}</label>
                    <div class="form-input">
                        <input name="oldPassword" ng-class="{'error': detailForm.oldPassword.$invalid && !detailForm.oldPassword.$pristine}" ng-model="blade.currentEntity.oldPassword" required placeholder="{{ 'platform.blades.account-changePassword.placeholders.current-password' | translate }}" type="password">
                    </div>
                    <div class="form-error" ng-if="detailForm.oldPassword.$dirty && detailForm.oldPassword.$invalid">
                        <span>{{ 'platform.blades.account-changePassword.validations.current-password' | translate }}</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">{{ 'platform.blades.account-changePassword.labels.new-password' | translate }}</label>
                    <div class="form-input">
                        <input name="newPassword" ng-model="blade.currentEntity.newPassword" ng-class="{'error': blade.currentEntity.oldPassword == blade.currentEntity.newPassword2}" required placeholder="{{ 'platform.blades.account-changePassword.placeholders.new-password' | translate }}" type="password">
                    </div>
                    <div class="form-error" ng-if="blade.currentEntity.oldPassword == blade.currentEntity.newPassword && !detailForm.newPassword.$pristine">
                        <span>{{ 'platform.blades.account-changePassword.validations.new-password' | translate }}</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="form-label">{{ 'platform.blades.account-changePassword.labels.repeat-password' | translate }}</label>
                    <div class="form-input">
                        <input name="newPassword2" ng-model="blade.currentEntity.newPassword2" ng-class="{'error': blade.currentEntity.newPassword != blade.currentEntity.newPassword2}" required placeholder="{{ 'platform.blades.account-changePassword.placeholders.repeat-password' | translate }}" type="password" ui-validate=" '$value==blade.currentEntity.newPassword' " ui-validate-watch=" 'blade.currentEntity.newPassword' ">
                    </div>
                    <div class="form-error" ng-if="!detailForm.newPassword2.$pristine && blade.currentEntity.newPassword != blade.currentEntity.newPassword2">
                        <span>{{ 'platform.blades.account-changePassword.validations.repeat-password' | translate }}</span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>